package com.ete.lib.upload

import com.blankj.utilcode.util.NetworkUtils
import com.ete.lib.upload.bean.HardwareEntry
import com.ete.lib.upload.bean.UploadEntry
import com.ete.lib.upload.hardware.IUploadCallback
import com.ete.lib.upload.hardware.UploadHardwareUtil
import com.ete.lib.upload.logZip.UploadLogUtil
import java.io.File

/**
 * Author:LiXian
 * <p>
 * Desc:上报信息
 * Version:1.0
 * date 2024/1/8 13:39
 */
object UploadManager {

    const val TAG = "UploadHardware"

    /**
     * 初始化
     */
    @JvmStatic
    fun init(mUploadEntry: UploadEntry) {
        UploadLogUtil.init(mUploadEntry)
    }

    /**
     * 删除App日志压缩文件
     */
    @JvmStatic
    fun deleteAppZipLogFile() {
        UploadLogUtil.deleteAppZipLogFile()
    }

    /**
     * 是否有App日志压缩包
     */
    @JvmStatic
    fun isHadAppZipLogFile(): Boolean {
        return UploadLogUtil.isHadAppZipLogFile()
    }

    /**
     * 获取App日志压缩包
     */
    @JvmStatic
    fun getAppZipLogFile(): File? {
        return UploadLogUtil.getAppZipLogFile()
    }

    /**
     * App日志文件上传
     */
    @JvmStatic
    fun uploadAppLogFile() {
        UploadLogUtil.uploadAppLogFile()
    }

    /**
     * 上报硬件信息
     *
     * @param mHardwareEntries 硬件信息
     * @param mCallback 上报回调
     */
    @JvmStatic
    @JvmOverloads
    fun uploadHardwareInfo(mHardwareEntries: List<HardwareEntry>, mCallback: IUploadCallback? = null) {
        UploadHardwareUtil.uploadHardwareInfo(mHardwareEntries, mCallback)
    }

    /**
     * 获取网络类型
     */
    @JvmStatic
    fun getNetworkType(): Int {
        return UploadHardwareUtil.getNetworkType()
    }
}